// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//

using System;
using System.Runtime.CompilerServices; //
using Xunit;

// Generated by Fuzzlyn v1.5 on 2023-06-15 11:14:42
// Run on X64 Windows
// Seed: 12107000858227890808
// Reduced from 443.3 KiB to 0.8 KiB in 00:02:06
// Debug: Outputs 1
// Release: Outputs 0
public struct S0
{
    public ushort F2;
    public short F3;
    public bool F5;
    public sbyte F7;
    public uint F8;
    public S0(ushort f2): this()
    {
        F2 = f2;
    }
}

public class Runtime_87611
{
    public static IRuntime s_rt;
    public static uint s_1;

    private static bool s_result = true;

    [Fact]
    public static int TestEntryPoint()
    {
        s_rt = new Runtime();
        S0 vr2 = new S0(1);
        var vr3 = vr2.F3;
        var vr4 = (short)M1(vr2, vr3);
        M1(vr2, vr4);
        s_rt.WriteLine(vr2.F2);
        s_rt.WriteLine(vr2.F2);
        return s_result ? 100 : 101;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    public static ref uint M1(S0 arg0, short arg1)
    {
        s_rt.WriteLine(arg0.F2);
        if (arg0.F2 != 1)
        {
            Console.WriteLine("FAIL: Saw {0}", arg0.F2);
            s_result = false;
        }
        return ref s_1;
    }
}

public interface IRuntime
{
    void WriteLine<T>(T value);
}

public class Runtime : IRuntime
{
    public void WriteLine<T>(T value)
    {
    }
}
